/*
 *  Copyright (c) 2018-present, Facebook, Inc.
 *  All rights reserved.
 *
 *  This source code is licensed under the BSD-style license found in the
 *  LICENSE file in the root directory of this source tree.
 */

#pragma once

#include <fizz/crypto/aead/Aead.h>
#include <fizz/protocol/Types.h>
#include <folly/String.h>
#include <folly/io/IOBuf.h>
#include <folly/ssl/OpenSSLPtrTypes.h>

// @lint-ignore-every PRIVATEKEY

namespace fizz {
namespace test {

constexpr folly::StringPiece kEd25519Key = R"(
-----BEGIN PRIVATE KEY-----
MC4CAQAwBQYDK2VwBCIEINDCVMS1CMCgqf2SUdOQl/1ilCd67zNqlImeOBP8DJFr
-----END PRIVATE KEY-----
)";

constexpr folly::StringPiece kEd25519PublicKey = R"(
-----BEGIN PUBLIC KEY-----
MCowBQYDK2VwAyEAvXS5jZQpYCHV3DziV9F6PrH7zmd44/jO793mczej1+o=
-----END PUBLIC KEY-----
)";

constexpr folly::StringPiece kEd25519Certificate = R"(
-----BEGIN CERTIFICATE-----
MIIBXTCCAQ8CFFOx7Unm3rmX57I6phuWsecBc9mpMAUGAytlcDBRMQswCQYDVQQG
EwJYWDEVMBMGA1UEBwwMRGVmYXVsdCBDaXR5MRwwGgYDVQQKDBNEZWZhdWx0IENv
bXBhbnkgTHRkMQ0wCwYDVQQDDARGaXp6MB4XDTIwMDUxNjAwMzAxMVoXDTQwMDUx
MTAwMzAxMVowUTELMAkGA1UEBhMCWFgxFTATBgNVBAcMDERlZmF1bHQgQ2l0eTEc
MBoGA1UECgwTRGVmYXVsdCBDb21wYW55IEx0ZDENMAsGA1UEAwwERml6ejAqMAUG
AytlcAMhAL10uY2UKWAh1dw84lfRej6x+85neOP4zu/d5nM3o9fqMAUGAytlcANB
AONhPabQCW2kBi7kZ5bX8kQgrxSDZusESh/02gMel9b2CpW+24UH1ZDfmGY5mJy1
NAI85uRq0GsoJsSad8CJ4wk=
-----END CERTIFICATE-----
)";

constexpr folly::StringPiece kEd448Key = R"(
-----BEGIN PRIVATE KEY-----
MEcCAQAwBQYDK2VxBDsEOWdYg9tVktUUJwpDTtti6D2MuDb1M7rZ+uIhZSddLhu0
375Dom/0xZsdKhEuisrgYNJa9OH7ST7YOA==
-----END PRIVATE KEY-----
)";

constexpr folly::StringPiece kEd448PublicKey = R"(
-----BEGIN PUBLIC KEY-----
MEMwBQYDK2VxAzoAHIz+4aGo1599po9r6UXFle3rwi/CnyESbACf4SwNLQX+fIZL
j/XXTLbAqyQUskY6VdUc1olg4ssA
-----END PUBLIC KEY-----
)";

constexpr folly::StringPiece kP256Key = R"(
-----BEGIN EC PRIVATE KEY-----
MHcCAQEEIHMPeLV/nP/gkcgU2weiXl198mEX8RbFjPRoXuGcpxMXoAoGCCqGSM49
AwEHoUQDQgAEnYe8rdtl2Nz234sUipZ5tbcQ2xnJWput//E0aMs1i04h0kpcgmES
ZY67ltZOKYXftBwZSDNDkaSqgbZ4N+Lb8A==
-----END EC PRIVATE KEY-----
)";

constexpr folly::StringPiece kP256PublicKey = R"(
-----BEGIN PUBLIC KEY-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEnYe8rdtl2Nz234sUipZ5tbcQ2xnJ
Wput//E0aMs1i04h0kpcgmESZY67ltZOKYXftBwZSDNDkaSqgbZ4N+Lb8A==
-----END PUBLIC KEY-----
)";

constexpr folly::StringPiece kP256K1Key = R"(
-----BEGIN EC PRIVATE KEY-----
MHQCAQEEIO/faBJKYzuLCTg58AIyWbeu2c6VVuPToCrINFj4y8wToAcGBSuBBAAK
oUQDQgAEW5bWEQR9xaAT0Zaev8QmA/lzz1a9+z1cphweKH8ynBYmWiWivaqGcVAU
Lt/SKc3HlcKGQhblkaGHEt3pCQeZUA==
-----END EC PRIVATE KEY-----
)";

constexpr folly::StringPiece kP256Certificate = R"(
-----BEGIN CERTIFICATE-----
MIIB7jCCAZWgAwIBAgIJAMVp7skBzobZMAoGCCqGSM49BAMCMFQxCzAJBgNVBAYT
AlVTMQswCQYDVQQIDAJOWTELMAkGA1UEBwwCTlkxDTALBgNVBAoMBEZpenoxDTAL
BgNVBAsMBEZpenoxDTALBgNVBAMMBEZpenowHhcNMTcwNDA0MTgyOTA5WhcNNDEx
MTI0MTgyOTA5WjBUMQswCQYDVQQGEwJVUzELMAkGA1UECAwCTlkxCzAJBgNVBAcM
Ak5ZMQ0wCwYDVQQKDARGaXp6MQ0wCwYDVQQLDARGaXp6MQ0wCwYDVQQDDARGaXp6
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEnYe8rdtl2Nz234sUipZ5tbcQ2xnJ
Wput//E0aMs1i04h0kpcgmESZY67ltZOKYXftBwZSDNDkaSqgbZ4N+Lb8KNQME4w
HQYDVR0OBBYEFDxbi6lU2XUvrzyK1tGmJEncyqhQMB8GA1UdIwQYMBaAFDxbi6lU
2XUvrzyK1tGmJEncyqhQMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDRwAwRAIg
NJt9NNcTL7J1ZXbgv6NsvhcjM3p6b175yNO/GqfvpKUCICXFCpHgqkJy8fUsPVWD
p9fO4UsXiDUnOgvYFDA+YtcU
-----END CERTIFICATE-----
)";

constexpr folly::StringPiece kP384Key = R"(
-----BEGIN EC PRIVATE KEY-----
MIGkAgEBBDCq2Al9+ZmWvvKXeKF4x+P0D3BvbFD9uxxgixjp2pVrGiQeybNLsmgz
aCjz+ETbBEKgBwYFK4EEACKhZANiAASBEEGWK7rJhZ6yqhmkdS5XOUnT8euKvLEx
wWdOdQYfXhe2okck7rcyaO2C/T0r/JPbiMq7+MnankwUef/bmlS1IpkK70AcGrAE
qh/fDiaqhpLKWGCtb2z46ju5Xb7LgqM=
-----END EC PRIVATE KEY-----
)";

constexpr folly::StringPiece kP384PublicKey = R"(
-----BEGIN PUBLIC KEY-----
MHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEgRBBliu6yYWesqoZpHUuVzlJ0/Hriryx
McFnTnUGH14XtqJHJO63Mmjtgv09K/yT24jKu/jJ2p5MFHn/25pUtSKZCu9AHBqw
BKof3w4mqoaSylhgrW9s+Oo7uV2+y4Kj
-----END PUBLIC KEY-----
)";

constexpr folly::StringPiece kP384Certificate = R"(
-----BEGIN CERTIFICATE-----
MIICJzCCAaygAwIBAgIJAOzjkDsjaGgLMAoGCCqGSM49BAMCMFExCzAJBgNVBAYT
AlVTMRUwEwYDVQQHDAxEZWZhdWx0IENpdHkxHDAaBgNVBAoME0RlZmF1bHQgQ29t
cGFueSBMdGQxDTALBgNVBAMMBGZpenowHhcNMTgwNzI3MjIwNTE2WhcNMTgwODI2
MjIwNTE2WjBRMQswCQYDVQQGEwJVUzEVMBMGA1UEBwwMRGVmYXVsdCBDaXR5MRww
GgYDVQQKDBNEZWZhdWx0IENvbXBhbnkgTHRkMQ0wCwYDVQQDDARmaXp6MHYwEAYH
KoZIzj0CAQYFK4EEACIDYgAEgRBBliu6yYWesqoZpHUuVzlJ0/HriryxMcFnTnUG
H14XtqJHJO63Mmjtgv09K/yT24jKu/jJ2p5MFHn/25pUtSKZCu9AHBqwBKof3w4m
qoaSylhgrW9s+Oo7uV2+y4Kjo1AwTjAdBgNVHQ4EFgQUn8WNTodJ81ytFl+3BWKI
I9X784wwHwYDVR0jBBgwFoAUn8WNTodJ81ytFl+3BWKII9X784wwDAYDVR0TBAUw
AwEB/zAKBggqhkjOPQQDAgNpADBmAjEA6S4jXP5fruwrmszizG854snSHl5LVEuQ
8F6RIEsOnWSbKBBoteaSXwA6Tv+jYZnmAjEA8YU0LnO+eA75Aku0mPDQsVJOjCvX
OMc6lsBbEEu0yLF89FcMYbxH2JCRxa528qd+
-----END CERTIFICATE-----
)";

constexpr folly::StringPiece kP521Key = R"(
-----BEGIN EC PRIVATE KEY-----
MIHcAgEBBEIBPYFDNkfM6VuyQKVaQigvLTeKXcPWr4qMLHtN4V81QZLIE9HJvL29
hbqwRG/kw2XM8ZQSnsqd1XTevQSfEPK45+CgBwYFK4EEACOhgYkDgYYABAGnbVsM
QvVX5Bi/mCs1bpA/k3udUwzKglDgfJjKAyk5WLL6jaIPnE6fdoTfPocrRw2sU2hp
e2ZM5MZ3P+uIYnB7XwFDQYLrlio6qKcHyGjKpu3uYt2EVhcu8L1zj6w6uwToe9Pp
6pwb0J+HIKmUxhYstCVG+G4yjekwOH6OzCxo7EG88g==
-----END EC PRIVATE KEY-----
)";

constexpr folly::StringPiece kP521PublicKey = R"(
-----BEGIN PUBLIC KEY-----
MIGbMBAGByqGSM49AgEGBSuBBAAjA4GGAAQBp21bDEL1V+QYv5grNW6QP5N7nVMM
yoJQ4HyYygMpOViy+o2iD5xOn3aE3z6HK0cNrFNoaXtmTOTGdz/riGJwe18BQ0GC
65YqOqinB8hoyqbt7mLdhFYXLvC9c4+sOrsE6HvT6eqcG9CfhyCplMYWLLQlRvhu
Mo3pMDh+jswsaOxBvPI=
-----END PUBLIC KEY-----
)";

constexpr folly::StringPiece kP521Certificate = R"(
-----BEGIN CERTIFICATE-----
MIICcTCCAdKgAwIBAgIJAMaW6GnzHQdaMAoGCCqGSM49BAMCMFExCzAJBgNVBAYT
AlhYMRUwEwYDVQQHDAxEZWZhdWx0IENpdHkxHDAaBgNVBAoME0RlZmF1bHQgQ29t
cGFueSBMdGQxDTALBgNVBAMMBGZpenowHhcNMTgwNzI3MjIwNjI2WhcNMTgwODI2
MjIwNjI2WjBRMQswCQYDVQQGEwJYWDEVMBMGA1UEBwwMRGVmYXVsdCBDaXR5MRww
GgYDVQQKDBNEZWZhdWx0IENvbXBhbnkgTHRkMQ0wCwYDVQQDDARmaXp6MIGbMBAG
ByqGSM49AgEGBSuBBAAjA4GGAAQBp21bDEL1V+QYv5grNW6QP5N7nVMMyoJQ4HyY
ygMpOViy+o2iD5xOn3aE3z6HK0cNrFNoaXtmTOTGdz/riGJwe18BQ0GC65YqOqin
B8hoyqbt7mLdhFYXLvC9c4+sOrsE6HvT6eqcG9CfhyCplMYWLLQlRvhuMo3pMDh+
jswsaOxBvPKjUDBOMB0GA1UdDgQWBBRqn91E64NUNowqgdlYhJCerng6bTAfBgNV
HS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EBTADAQH/MA4GA1Ud
DwEB/wQEAwIBhjANBgkqhkiG9w0BAQsFAAOCAgEADtD+hggO5YSCsTJN6EwzttJ+
cs8baCm1n9ElxHbNplaHsoRR0xxUgV7FcKkEPqQaEY81FuU34t8tcBmnoAmmt2K1
aNyGeMCH/BJRzwTtzUsayv/OdYOsndXoSflSTPAcAQvipwLEYWVfMkyfLtKXOkcc
Zk1/uxEeT2CtMoPXePd9fNs80kRAXPnuNgg9Hyz9lAA3/HAWCqjr25NEenEJm+Jn
v5A73iAKwLGabCwMu8231SGTVe1kw94n3EMGYZUJ3Cuf+Wd76EEmri/CqL6iFFAq
Jm0+jo2kqacTIxaDWvxpZx5dUDy7U/4+F0Tn4i+4PmAPMXlmUqdhXiXrIAcvwN/x
Y5flgUR63wjwnCWqTgv54mxm5MvILxr66b75qx1ORtYms/zksOb0hUUNBNsuo6rb
r3Wd6FQ7SXI4UoplpaHZknw7pGNk/U7tqznz1KjfYYBhbg9TAa/e9zSPmm5BLMZB
+lKCyOAi3qNRfUs80AzJd+MSGw2QSD+wGMzCRwb9kdjtYTbxfzSR9HQLj3iMWiIf
2qt6iPt3YSAMphBOi+DrStrUpKsFeYzD6gGMgjfYtCDlrmjNoObfjkP5n1viRn8g
1Ur2kDbFrm8vyRCnVJUfkJwot3F9gbv0bj22HA46sDisEc3D380tiR55mjiLKa8r
wt3Vj1V7ondA7QQEDuE=
-----END CERTIFICATE-----
)";

constexpr folly::StringPiece kClientAuthClientCert = R"(
-----BEGIN CERTIFICATE-----
MIIErzCCApegAwIBAgICEAAwDQYJKoZIhvcNAQELBQAwGjELMAkGA1UEBhMCVVMx
CzAJBgNVBAgMAkNBMCAXDTE3MDkwMTIxMDU1MloYDzIxMTcwODA4MjEwNTUyWjBj
MQswCQYDVQQGEwJVUzELMAkGA1UECAwCQ0ExDTALBgNVBAsMBEZpenoxFDASBgNV
BAMMC0ZpenogQ2xpZW50MSIwIAYJKoZIhvcNAQkBFhNmaXp6Y2xpZW50QGZpen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j1vewz+sQ0goPzNM/ocAsJJx
r3ZsBE4W0UOqu2YBispQmW+5V8tAAwrJFtCmzx4FkeozKzZkLUynFytSmEdG/rvr
JbVURz/cSWXWSdRyJ1HUbqXWJs4+kWdBTCBheO+NcqZMBuDnCKaBKosV62kCgYEA
mvx9ES+Cy9Rrl6CGep0w012C+GkcbpS0zM5AmWqKpig/I/tAx2HFcxC+WHlvYI33
azPYrlymX8JK3uSuG1/2Xxnh7IQPvc33UoiD3nJfSDPzWt8U/QgWsPDaI+2dh1zs
VU+D0nUGmf/pM3F2/ErRq/iXGAqMlMFff//Cg2rFMnMCgYEA7De3L3aNpHFWhtUi
7c3DGtP3qTC6FAS9GJlA1TVsjgHt4nL3ZAKWOqXwVa1kXNDeYgN/Br39dfYW/KRE
Liz9kBryc02/2YSjg4YFDgrCqzeERPmwj8AKM3sPyL+nLzZOvJ3EbhyiQiOYGh+U
osLtL9tFEp8IrKHnoNVDuMPaZPM=
-----END PRIVATE KEY-----
)";

std::unique_ptr<folly::IOBuf> toIOBuf(folly::StringPiece hexData);

folly::ssl::EvpPkeyUniquePtr getPrivateKey(folly::StringPiece key);

folly::ssl::EvpPkeyUniquePtr getPublicKey(folly::StringPiece key);

folly::ssl::X509UniquePtr getCert(folly::StringPiece cert);

std::unique_ptr<folly::IOBuf> getCertData(folly::StringPiece cert);

void useMockRandom();

std::unique_ptr<Aead> getCipher(CipherSuite cipher);

} // namespace test
} // namespace fizz
